package net.dodoman.key;

import java.awt.Component;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class KeyEventTest extends Component {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7101108229931009297L;

	public static void main(String[] args) {
		KeyEventTest test = new KeyEventTest();
		test.addKeyListener(test.new KeyHandler());
	}

	class KeyHandler implements KeyListener {

		public void keyPressed(KeyEvent e) {
			System.out.println("KeyCode:" + e.getKeyCode());
			System.out.println("KeyText:" + e.getKeyText(e.getKeyCode()));
			System.out.println("ActionKey:" + e.isActionKey());
		}

		public void keyReleased(KeyEvent e) {

		}

		public void keyTyped(KeyEvent e) {
			System.out.println("KeyChar:" + e.getKeyChar());
		}
	}

}